interface Person {
    firstName:string,
    lastName:string
}
function greeter(person: Person) {
    return "Hello, " + person;
}

let user = {firstName:"Jane User",lastName:"lgz"};
//console.log(greeter(user))
enum Color {
    Red = 1,
    Green,
    Blue
}
let c:Color=Color.Blue;
console.log(c)

interface ClockConstructor {
    new (hour: number, minute: number);
}

interface ClockConstructor {
    new (hour: number, minute: number): ClockInterface;
}
interface ClockInterface {
    tick();
}

function createClock(ctor: ClockConstructor, hour: number, minute: number): ClockInterface {
    return new ctor(hour, minute);
}

class DigitalClock implements ClockInterface {
    constructor(h: number, m: number) { }
    tick() {
        console.log("beep beep");
    }
}
class AnalogClock implements ClockInterface {
    constructor(h: number, m: number) { }
    tick() {
        console.log("tick tock");
    }
}

let digital = createClock(DigitalClock, 12, 17);
let analog = createClock(AnalogClock, 7, 32);